{load header}
<!--/H-->

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav -->
                        <!-- nav -->
            

            
	<div class="main-title">
		<h2>评论管理</h2>
	</div>
	<div class="cf">

		<!-- 高级搜索 -->
		<div class="search-form fr cf">
			<div class="sleft">
                                <div class="drop-down">
					<span id="sch-sort-txt" class="sort-txt" data="{if $icon_type}{$icon_type}{else}1{/if}">{if $icon}{$icon}{else}ID{/if}</span>
					<i class="arrow arrow-down"></i>
					<ul id="sub-sch-menu" class="nav-list hidden">
                                            <li><a href="javascript:;" value="1">ID</a></li>
                                            <li><a href="javascript:;" value="2">标题</a></li>
					</ul>
				</div>
				<input type="text" name="q" class="search-input" value="{$keyword}" placeholder="请输入关键词">
				<a class="sch-btn" href="javascript:;" id="search" url=""><i class="btn-search"></i></a>
			</div>
		</div>
	</div>
	<div class="tab-wrap">
		
		<div class="tab-content">
			
			<!-- 数据列表 -->
			<div class="data-table table-striped">
				<table style="table-layout:fixed;">
					<thead>
						<tr>
						<th>id</th>
						<th>评论用户id</th>
						<th>帖子id</th>
                                                <th>作者id</th>
						<th style="word-wrap:break-word;width:300px;">标题</th>
                                                <th style="word-wrap:break-word;width:600px;">评论内容</th>
                                                <th style="width: 120px;">评论时间</th>
                                                <th>显示</th>
                                                <th>评论id</th>
                                                <th>评论类型</th>
						</tr>
					</thead>
					<tbody>
						<!--{loop $list $k1 $val}-->
						<tr>
                                                        <td>{$val['id']}</td>
							<td>{$val['uid']}</td>
							<td>{$val['article_id']}</td>
                                                        <td>{$val['authorid']}</td>
                                                        <td>{$val['title']}</td>
                                                        <td style="word-wrap:break-word;">
                                                            {$val['content']}
                                                        </td>
                                                        <td>{$val['create_time']}</td>
                                                        <td>
                                                            <a title="<!--{if ($val['is_show'])=='0' }-->点击显示<!--{else}-->点击隐藏<!--{/if}-->" href="{eval echo site_url('community/commshow').'?id='.$val['id'].'&status='.abs(1-$val['is_show']).''}" class="ajax-get"><!--{if ($val['is_show'])=='0' }--><span style="color:#ff0000">隐藏</span><!--{else}-->显示<!--{/if}--></a>
                                                        </td>
                                                        <td>{$val['cid']}</td>
                                                        <td>
                                                            <!--{if ($val['type'])=='0' }-->帖子评论<!--{else}-->评论回复<!--{/if}--></a>
                                                        </td>
						</tr>
						<!--{/loop}-->
					</tbody>
				</table>
				<!-- 分页 -->
				<div class="page">
					<div>
					{$showpage}
					<span class="rows">共 {$Total} 条记录</span>
					</div>
				</div>
			</div>
	
		</div>
	</div>
<script>
    $(function(){
	//搜索功能
	$("#search").click(function(){
            
            var url = $(this).attr('url');
            var status = $("#sch-sort-txt").attr("data");
            var query  = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
		if(status != ''){
			query += '&st=' + status ;
        }
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});

	/* 状态搜索子菜单 */
	
	$(".search-form").find(".drop-down").hover(function(){
		$("#sub-sch-menu").removeClass("hidden");
	},function(){
		$("#sub-sch-menu").addClass("hidden");
	});
	$("#sub-sch-menu li").find("a").each(function(){
		$(this).click(function(){
			var text = $(this).text();
			$("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
			$("#sub-sch-menu").addClass("hidden");
		})
	});
        	
    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });
    
    /* 实时更新分类信息 */
    $(".tab-content")
            .on("submit", "form", function(){
                    var self = $(this);
                    $.post(
                            self.attr("action"),
                            self.serialize(),
                            "json"
                    );
                    return false;
            })
            .on("focus","input",function(){
                    $(this).data('param',$(this).closest("form").serialize());

                })
            .on("blur", "input", function(){
                    if($(this).data('param')!=$(this).closest("form").serialize()){
                        $(this).closest("form").submit();
                    }
                });
    
})
</script>
<!--F-->{load footer}